#ifndef _H_REGS_H
#define _H_REGS_H

#define REG(addr)			(*(volatile unsigned int*)(addr))

#define NOINT				(0xc0)
#define MODE_USER			(0x10)
#define MODE_FIQ			(0x11)
#define MODE_IRQ			(0x12)
#define MODE_SVC			(0x13)
#define MODE_ABORT			(0x17)
#define MODE_UNDEF			(0x1b)
#define MODE_SYSTEM			(0x1f)
#define MODE_MASK			(0x1f)

#define MEM_CTRL_BASE		(0x48000000)
#define rBWSCON				(MEM_CTRL_BASE + 0x0)
#define rBANKCON0			(MEM_CTRL_BASE + 0x4)
#define rBANKCON1			(MEM_CTRL_BASE + 0x8)
#define rBANKCON2			(MEM_CTRL_BASE + 0xc)
#define rBANKCON3			(MEM_CTRL_BASE + 0x10)
#define rBANKCON4			(MEM_CTRL_BASE + 0x14)
#define rBANKCON5			(MEM_CTRL_BASE + 0x18)
#define rBANKCON6			(MEM_CTRL_BASE + 0x1c)
#define rBANKCON7			(MEM_CTRL_BASE + 0x20)
#define rREFRESH			(MEM_CTRL_BASE + 0x24)
#define rBANKSIZE			(MEM_CTRL_BASE + 0x28)
#define rMRSRB6				(MEM_CTRL_BASE + 0x2c)
#define rMRSRB7				(MEM_CTRL_BASE + 0x30)

#define UART_CTRL0_BASE		(0x50000000)
#define UART_CTRL1_BASE		(0x50004000)
#define UART_CTRL2_BASE		(0x50008000)

#define rULCON0				(UART_CTRL0_BASE + 0x0)
#define rUCON0				(UART_CTRL0_BASE + 0x4)
#define rUFCON0				(UART_CTRL0_BASE + 0x8)
#define rUMCON0				(UART_CTRL0_BASE + 0xc)
#define rUTRSTAT0			(UART_CTRL0_BASE + 0x10)
#define rUERSTAT0			(UART_CTRL0_BASE + 0x14)
#define rUFSTAT0			(UART_CTRL0_BASE + 0x18)
#define rUMSTAT0			(UART_CTRL0_BASE + 0x1c)
#define rUTXH0				(UART_CTRL0_BASE + 0x20)
#define rURXH0				(UART_CTRL0_BASE + 0x24)
#define rUBRDIV0			(UART_CTRL0_BASE + 0x28)

#define rULCON1				(UART_CTRL1_BASE + 0x0)
#define rUCON1				(UART_CTRL1_BASE + 0x4)
#define rUFCON1				(UART_CTRL1_BASE + 0x8)
#define rUMCON1				(UART_CTRL1_BASE + 0xc)
#define rUTRSTAT1			(UART_CTRL1_BASE + 0x10)
#define rUERSTAT1			(UART_CTRL1_BASE + 0x14)
#define rUFSTAT1			(UART_CTRL1_BASE + 0x18)
#define rUMSTAT1			(UART_CTRL1_BASE + 0x1c)
#define rUTXH1				(UART_CTRL1_BASE + 0x20)
#define rURXH1				(UART_CTRL1_BASE + 0x24)
#define rUBRDIV1			(UART_CTRL1_BASE + 0x28)

#define rULCON2				(UART_CTRL2_BASE + 0x0)
#define rUCON2				(UART_CTRL2_BASE + 0x4)
#define rUFCON2				(UART_CTRL2_BASE + 0x8)
#define rUMCON2				(UART_CTRL2_BASE + 0xc)
#define rUTRSTAT2			(UART_CTRL2_BASE + 0x10)
#define rUERSTAT2			(UART_CTRL2_BASE + 0x14)
#define rUFSTAT2			(UART_CTRL2_BASE + 0x18)
#define rUTXH2				(UART_CTRL2_BASE + 0x20)
#define rURXH2				(UART_CTRL2_BASE + 0x24)
#define rUBRDIV2			(UART_CTRL2_BASE + 0x28)

#define WATCHDOG_CTRL_BASE	(0x53000000)
#define rWTCON				(WATCHDOG_CTRL_BASE + 0x0)
#define rWTDATA				(WATCHDOG_CTRL_BASE + 0x4)

#define rGPACON				(0x56000000)
#define rGPADAT				(0x56000004)

#define rGPBCON				(0x56000010)
#define rGPBDAT				(0x56000014)
#define rGPBUP				(0x56000018)

#define rGPCCON				(0x56000020)
#define rGPCDAT				(0x56000024)
#define rGPCUP				(0x5600002c)

#define rGPDCON				(0x56000030)
#define rGPDDAT				(0x56000034)
#define rGPDUP				(0x56000038)

#define rGPECON				(0x56000040)
#define rGPEDAT				(0x56000044)
#define rGPEUP				(0x56000048)

#define rGPFCON				(0x56000050)
#define rGPFDAT				(0x56000054)
#define rGPFUP				(0x56000058)

#define rGPGCON				(0x56000060)
#define rGPGDAT				(0x56000064)
#define rGPGUP				(0x56000068)

#define rGPHCON				(0x56000070)
#define rGPHDAT				(0x56000074)
#define rGPHUP				(0x56000078)

#define rGPJCON				(0x560000d0)
#define rGPJDAT				(0x560000d4)
#define rGPJUP				(0x560000d8)

#define rMISCCR				(0x56000080)
#define rDCLKCON			(0x56000084)
#define rEXTINT0			(0x56000088)
#define rEXTINT1			(0x5600008c)
#define rEXTINT2			(0x56000090)

#define rEINTFLT0			(0x56000094)
#define rEINTFLT1			(0x56000098)
#define rEINTFLT2			(0x5600009c)
#define rEINTFLT3			(0x560000a0)

#define rEINTMASK			(0x560000a4)
#define rEINTPEND			(0x560000a8)

#define rGSTATUS0			(0x560000ac)
#define rGSTATUS1			(0x560000b0)
#define rGSTATUS2			(0x560000b4)
#define rGSTATUS3			(0x560000b8)
#define rGSTATUS4			(0x560000bc)

#define rDCS0				(0x560000c4)
#define rDCS1				(0x560000c8)
#define rMSLCON				(0x560000cc)

#define rLOCKTIME			(0x4c000000)
#define rMPLLCON			(0x4c000004)
#define rUPLLCON			(0x4c000008)
#define rCLKCON				(0x4c00000c)
#define rCLKSLOW			(0x4c000010)
#define rCLKDIVN			(0x4c000014)
#define rCAMDIVN			(0x4c000018)

#define rNFCONF				(0x4e000000)
#define rNFCONT				(0x4e000004)
#define rNFCMMD				(0x4e000008)
#define rNFADDR				(0x4e00000c)
#define rNFDATA				(0x4e000010)
#define rNFMECCD0			(0x4e000014)
#define rNFMECCD1			(0x4e000018)
#define rNFSECCD			(0x4e00001c)
#define rNFSTAT				(0x4e000020)
#define rNFESTAT0			(0x4e000024)
#define rNFESTAT1			(0x4e000028)
#define rNFMECC0			(0x4e00002c)
#define rNFMECC1			(0x4e000030)
#define rNFSECC				(0x4e000034)
#define rNFSBLK				(0x4e000038)
#define rNFEBLK				(0x4e00003c)

#define rTCFG0				(0x51000000)
#define rTCFG1				(0x51000004)
#define rTCON				(0x51000008)

#define rTCNTB0				(0x5100000c)
#define rTCMPB0				(0x51000010)
#define rTCNTO0				(0x51000014)

#define rTCNTB1				(0x51000018)
#define rTCMPB1				(0x5100001c)
#define rTCNTO1				(0x51000020)

#define rTCNTB2				(0x51000024)
#define rTCMPB2				(0x51000028)
#define rTCNTO2				(0x5100002c)

#define rTCNTB3				(0x51000030)
#define rTCMPB3				(0x51000034)
#define rTCNTO3				(0x51000038)

#define rTCNTB4				(0x5100003c)
#define rTCNTO4				(0x51000040)

#define rSRCPND				(0x4a000000)
#define rINTMOD				(0x4a000004)
#define rINTMSK				(0x4a000008)
#define rPRIORITY			(0x4a00000c)
#define rINTPND				(0x4a000010)
#define rINTOFFSET			(0x4a000014)
#define rSUBSRCPND			(0x4a000018)
#define rINTSUBMSK			(0x4a00001c)

#endif
